package myauctioneer.dto;

public class User {

	private int userId;
	private String name;
	private String address;
	private String phone;
	private String email;
	private String password;

	public User() {
	}

	public User(int userId, String name, String address, String phone,
			String email, String password) {
		super();
		this.userId = userId;
		this.name = name;
		this.address = address;
		this.phone = phone;
		this.email = email;
		this.password = password;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * Check whether the user has admin privileges.
	 */
	public boolean isAdmin()
	{
		if(this.getUserId() == 0)
			return false;

		return Integer.parseInt(myauctioneer.App.getProperty("user.admin_id", "0"))
			== this.getUserId();
	}
}
